
package com.zjff.myshop.admin.pojo.form;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
public class CategoryUpdateForm {

    @ApiModelProperty(value = "分类id", position = 1, required = true)
    @NotNull(message = "分类id不能为空 ")
    @Min(value = 1, message = "分类id>=1 ")
    private Integer id;

    @ApiModelProperty(value = "分类名称", position = 3, required = true)
    @NotEmpty(message = "Name不能为空 ")
    @Length(max = 16, message = "分类名称长<=16 ")
    private String name;

    @ApiModelProperty(value = "排序值", position = 4, required = true)
    @Min(value = 0, message = "排序值最低为0 ")
    @Max(value = 200, message = "排序值最高为200 ")
    @NotNull(message = "排序值不能为空 ")
    private Integer sort;

    @ApiModelProperty(value = "图片url", position = 5)
    private String img;
}